package tedu.study.day03;

public class IfElseDemo {
    public static void main(String[] args) {
        //1)奇数、偶数的判断
        int num = 8;//带数(5,8)
        if(num%2==0){
            System.out.println("num=" + num + "," + num + "是偶数");
        }else{
            System.out.println("num=" + num + "," + num + "是奇数");
        }
        System.out.println("继续执行......1");

        //2)满500打8折，不满则打9折
        double price = 300.0; //带数(600.0,300.0)
        double discountPrice = price;
        double savePrice = 0.0;
        if(price>=500){
            discountPrice = price * 0.8;
            savePrice = price - discountPrice;
        }else{
            discountPrice = price * 0.9;
            savePrice = price - discountPrice;
        }
        System.out.println("原价为:"+price);
        System.out.println("折扣后金额为:"+discountPrice);
        System.out.println("本次购物节省:"+savePrice);
        System.out.println("继续执行......2");

        //3)判断成绩是偶合法
        int score = -65;//带数(96,800,-65)
        if(score>=0 && score<=100){
            System.out.println("成绩为："+score+",成绩合法");
        }else{
            System.out.println("成绩为："+score+",成绩不合法");
        }
        System.out.println("继续执行......3");
    }
}
